<template>
  <div id="app">
    <!-- 公共头部组件 -->
    <h1>{{ $route.meta.title }}</h1>
    <button
      v-if="$route.name != 'index'"
      class="contrast"
      style="display: inline-block; width: auto"
      type="button"
      @click="() => $router.go(-1)">
      返回上级
    </button>
    <!-- 路由视图，相当于router-view -->
    <nuxt/>
    <!-- 公共底部组件 -->
    <div><strong>这是公共Footer</strong></div>
  </div>
</template>
<script>
  export default {
      name: 'Default',
      head() {
      return {
        title: this.$route.meta.title,
        meta: [
          {
            hid: 'description',
            name: 'description',
            content: this.$route.meta.title
          }
        ]
      }
    }
  }
  </script>